<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>增值业务无线平台</title>    
    <link href="<%=basePath%>css/outlookmenu.css" rel="stylesheet" type="text/css" />	
    <script type="text/javascript" src="<%=basePath%>js/outlookmenu.js"></script>
    <style type="text/css">
		html,body {
			font-family: Arial, Helvetica, sans-serif;
			font-size: 12px;
			margin: 0px;
			padding: 0px;
		}
	</style>
	<script type="text/javascript" language="javascript">		
		if(${requestScope.returnCode}==111){
			window.location.href="<%=request.getContextPath() %>/index.jsp";
		}
		function logout(){
    		document.logoutForm.submit();
    	}
    	function goManage(){
			window.location.href="<%=basePath%>logined!logined.shtml"
		}	
		function startTime() { 
			var today=new Date(); 
			var h=today.getHours(); 
			var m=today.getMinutes(); 
			var s=today.getSeconds(); 
			
			var d =today.getFullYear();    
			var y =today.getMonth()+1;  
			var tian =today.getDate();
			var week = today.getDay();  
			if(week==0){
				week="天"
			}
			m=checkTime(m); 
			s=checkTime(s); 
			document.getElementById('curtime').innerHTML=d+"年"+y+"月"+tian+"日<br />星期"+week+"  "+h+":"+m+":"+s+"&nbsp;"; 
			t=setTimeout('startTime()',1000); 
		}
		function checkTime(i) { 
			if (i<10){ 
			i="0"+i; 
			} 
			return i; 
		}
		function iframeResize(frameId, frameName) {   
		    var dyniframe   = null;   
		    var indexwin    = null;   
		    if (document.getElementById){   
		        if(!frameId) {
		            frameId = "mainFrame";   
		            frameName = "mainFrame";   
		        }   
		        dyniframe = document.getElementById(frameId);		           
		        indexwin = window;   
		        if (dyniframe!=null){   
		        
		             var contentHeight, win = indexwin.frames[frameName];		                         
		             if (win.innerHeight && win.scrollMaxY) {	                  
		             	contentHeight = win.innerHeight + win.scrollMaxY;   		             
		             } else if (win.document.body.scrollHeight > win.document.body.offsetHeight){	              
		             	contentHeight = win.document.body.scrollHeight + 20;
		             } else {
		               	contentHeight = win.document.body.offsetHeight + 10;   
		             }
		            
		          	 dyniframe.style.height = ((!contentHeight || contentHeight < 473) ? 473 : contentHeight)+"px" ;
		          	        	    
		        }   
		        
		    } 
		}		
    	
		function dis(aobject,tempimg,temp,url){
			return false;
			 var distitle = document.getElementById("distitle");
			 distitle.innerText=temp;
			 aobject.href=url;			 			
		}
		function displaymenu(){			
			var menutd = document.getElementById("menutd");
			var mengdiv = document.getElementById("mengdiv");			
			if(menutd.style.display=="none"){
				menutd.style.display="inline-block";
				mengdiv.style.background="url('images/goleft.png') no-repeat";
			}else if(menutd.style.display=="inline-block"){
				menutd.style.display="none";
				mengdiv.style.background="url('images/goright.png') no-repeat";
			}
		}
	</script>
  </head>
  <body onload="startTime();">
	<div style="border:0px solid red;height:100px;width:100%;background:#469BD1 url('images/logobg.jpg') no-repeat;;">
		<table cellpadding="0" cellspacing="0" width="100%" border="0" style="color:#24668F;">
			<tr><td colspan="6" height="6">&nbsp;</td></tr>
			<tr>
				<td rowspan="2">&nbsp;</td>				
				<td rowspan="2" height="80" width="100" title="当前时间" style="background:url('images/mantime.png') no-repeat top;" align="right" valign="bottom"><label id="curtime" style="position:relative;top:-2px;"></label></td>
				<td height="60" width="60" title="当前用户" style="background:url('images/manuser.png') no-repeat top;"></td>
				<td height="60" width="60" title="系统主页" style="background:url('images/manhome.png') no-repeat top;cursor:hand;" onclick="return goManage();"></td>
				<td height="60" width="60" title="退出系统" style="background:url('images/manexit.png') no-repeat top;cursor:hand;" onclick="return logout();">
					<form action="logined!logout.shtml" method="post" style="margin:0;padding:0;" name="logoutForm" id="logoutForm"></form>
				</td>
				<td height="60" width="20"></td>
			</tr>
			<tr>
				<td colspan="4">&nbsp;&nbsp;<label style="position:relative;top:-2px;">${sessionScope.User.loginname }</label></td>
			</tr>			
		</table>
	</div>
	<div style="height:1px;width:100%;background:#fff;"></div>
	<div style="height:3px;width:100%;background:#000;"></div>
	<table cellpadding="0" cellspacing="0" width="100%" border="0">
		<tr>		
		<td width="180" valign="top" style="display:inline-block;" id="menutd">
			<div style="font-weight:bold;font-size:14px;border:1px solid #C0DCF1;border-bottom:none;width:178px;height:30px;background:url('images/menutop.gif') repeat-x;">
				<span style="display:block;margin:7px 0 0 23px;color:#000;">博洛尼核算系统</span>
			</div>
			<div id="menu">
		    	<c:forEach items="${requestScope.menulist}" var="menu">
		    	<c:if test="${menu.menuparentid==0 }">
				<h4><img src="images/${menu.menuimg }" width="18" height="18" align="middle" style="margin-right:10px;" />${menu.menutitle}</h4>				
				<ul>
					<c:forEach items="${requestScope.menulist}" var="submenu">											
						<c:if test="${submenu.menuparentid==menu.menuid }">
							<li><a href="javasciprt:void(0);" onclick="return dis(this,'${submenu.menuimg }','${menu.menutitle} -- ${submenu.menutitle}','${submenu.menuurl }');" id="${submenu.menuid}" title="${submenu.menutitle}" target="mainFrame"><img src="images/${submenu.menuimg }" width="18" height="18" border="0" align="middle" style="margin-top:-4px;margin-right:10px;" />${submenu.menutitle}</a></li>							
						</c:if>
				  	</c:forEach>
				</ul>
				</c:if>
				</c:forEach>				      
		  	</div>
		</td>

		<td width="6" valign="top" height="100%" bgcolor="red" style="background:#000000;" align="center">
			<div style="width:8px;height:52px;background:url('images/goleft.png') no-repeat;margin-top: 250px;cursor:hand;" onclick="displaymenu();" id="mengdiv"></div>
		</td>
		<td valign="top" width="100%">
			<div>				
				<div style="font:normal 12px arial;border:1px solid #C0DCF1;border-bottom:none;height:30px;background:url('images/menutop.gif') repeat-x;">
					<span style="display:block;margin:7px 0 0 20px;color:#000;" id="distitle">欢迎莅临</span>
				</div>				
			</div>											
			<iframe src="" style="border:0px solid red;width:100%;height: 473px;" frameborder="0" id="mainFrame" name="mainFrame" onload="iframeResize(this.id,this.name)"></iframe>
		</td>
  		</tr>
	</table>
  </body>
</html>
<script type="text/javascript">
	var o = new neverModules.ui.outlookMenu("menu", "o")
	.setStyle("outlookMenu")
	.setAnimate({delay:10, increase:4, decrease:3})
	.render();
</script>
